Gets an
ICollection containing the values in the
IDictionary.
Syntax
Example
Library/Library.Test/TestLurchTable.cs
C# | Copy Code |
---|
var sample = GetSample();
var items = CreateSample(sample);
IDictionary<int, string> dict = items;
var values = new List<string>();
foreach (var kv in sample)
values.Add(kv.Value);
VerifyCollection(EqualityComparer<string>.Default, values.AsReadOnly(), items.Values);
VerifyCollection(EqualityComparer<string>.Default, values.AsReadOnly(), dict.Values); |
VB.NET | Copy Code |
---|
Dim sample As var = GetSample()
Dim items As var = CreateSample(sample)
Dim dict As IDictionary(Of Integer, String) = items
Dim values As var = New List(Of String)()
For Each kv As var In sample
values.Add(kv.Value)
Next
VerifyCollection(EqualityComparer(Of String).[Default], values.AsReadOnly(), items.Values)
VerifyCollection(EqualityComparer(Of String).[Default], values.AsReadOnly(), dict.Values) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also